Fix GDPopt LBB time-limit results#3942
Conversation
bernalde
left a comment
There was a problem hiding this comment.
Review summary
- Blocking issues: none.
- Nonblocking issues: none.
- Questions: none.
- Tests run:
pytest -q pyomo/contrib/gdpopt/tests/test_LBB.py::TestGDPopt_LBB_TimeLimit::test_time_limit_returns_pyomo_results_object pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py::TestMindtPyGOATimeLimit::test_goa_time_limit_sets_solver_results_condition- passed, 2 passed in 0.50s.pytest -q pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passed, 32 passed, 9 skipped, 2 deselected in 1.69s.python -m black --check --diff pyomo/contrib/gdpopt/branch_and_bound.py pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passed, 3 files unchanged. Black emitted its Python 3.13 / Python 3.14 parser warning but completed successfully.git diff --check upstream/main...HEAD -- pyomo/contrib/gdpopt/branch_and_bound.py pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passed.gh pr checks 3942 --repo Pyomo/pyomo- currently pending overall. Passing at review time: Read the Docs, lint/style-and-typos, linux/3.10/bare-env, linux/3.10/slim, linux/3.11/mpi, linux/3.12/numpy2. Remaining GitHub Actions matrix jobs and Jenkins inspection are still pending.
- Merge as-is: I do not see code changes needed from review, but I would wait for the pending required CI/Jenkins statuses before merging.
|
Coordination note for #3946: This PR and #3946 fix different bugs. This one fixes the LBB time-limit result path for #3941; #3946 fixes continuous-node solver dispatch for #3945. #3946 does not supersede this PR. I checked the combined patches with Recommendation: merge this PR first since it is smaller and already through the GitHub Actions matrix, then refresh/rebase #3946 afterward. |
emma58
left a comment
There was a problem hiding this comment.
In the long run we should think about moving the GDPopt solvers onto the new contrib.solver results object, but this looks good for now--it fixes a dumb bug in LBB leftover from a long ago GDPopt rewrite.
|
|
||
| class TestMindtPyGOATimeLimit(unittest.TestCase): | ||
| def test_goa_time_limit_sets_solver_results_condition(self): | ||
| from pyomo.contrib.mindtpy.global_outer_approximation import MindtPy_GOA_Solver |
There was a problem hiding this comment.
Can you move the import to the top of the file?
There was a problem hiding this comment.
Addressed in ede4b3787 by moving MindtPy_GOA_Solver to the file-level imports in pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py. The GOA regression still passes with pytest -q pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py::TestMindtPyGOATimeLimit::test_goa_time_limit_sets_solver_results_condition.
|
Review comments addressed. Commits pushed:
Main changes made:
Tests run:
Comments intentionally not addressed:
Remaining risks or follow-up items:
|
Summary
_get_final_results_object()call on the time-limit path with_get_final_pyomo_results_object().maxTimeLimitresults.maxTimeLimitonSolverResults.Tests run
pytest -q pyomo/contrib/gdpopt/tests/test_LBB.py::TestGDPopt_LBB_TimeLimit::test_time_limit_returns_pyomo_results_object pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py::TestMindtPyGOATimeLimit::test_goa_time_limit_sets_solver_results_condition- passed, 2 passed in 0.52spytest -q pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passed, 32 passed, 9 skipped, 2 deselected in 1.86spython -m black --check --diff pyomo/contrib/gdpopt/branch_and_bound.py pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passed, 3 files would be left unchangedgit diff --check -- pyomo/contrib/gdpopt/branch_and_bound.py pyomo/contrib/gdpopt/tests/test_LBB.py pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py- passedNotes about tests not run
Closes #3941